home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK2.toast / Development Kits (Disc 2) / QuickDraw GX / Programming Stuff / GX Libraries / FontLibrary.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-31  |  2.8 KB  |  98 lines  |  [TEXT/MPS ]

  1.  
  2. /*
  3.     File:        FontLibrary.h
  4.  
  5.     Contains:    graphics libraries - font library interfaces
  6.  
  7.     Written by:    Cary Clark, Georgiann Delaney, Michael Fairman, Dave Good, Robert Johnson, Keith McGreggor, Oliver Steele, David Van Brink, Chris Yerga
  8.  
  9.     Copyright:    © 1995 by Apple Computer, Inc., all rights reserved.
  10.  
  11.     Change History (most recent first):
  12.  
  13.          <1>      1/9/95    JD        First checked in.
  14. */
  15.  
  16. #ifndef __FONTLIBRARY__
  17. #define __FONTLIBRARY__
  18.  
  19. #include <GXTypes.h>
  20. #include <GXFonts.h>
  21.  
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25.  
  26. /* for compatibility with old headers */
  27. #define fontLibraryIncludes
  28.  
  29. /*  example gxFont descriptor tags
  30. */
  31. #define weightVariationTag            0x77676874    /* 'wght' */
  32. #define widthVariationTag            0x77647468    /* 'wdth' */
  33. #define slantVariationTag            0x736c6e74    /* 'slnt' */
  34. #define opticalScaleVariationTag    0x6f70737a    /* 'opsz' */
  35.  
  36. /* weights for gxStyle matching */
  37. /* these will have to be tweaked*/
  38. /* this info could be in the gxFont???*/
  39. #define prefwghtweighting        0x00010000
  40. #define prefwdthweighting        0x00020000
  41. #define prefslntweighting        0x00010000    /*this is naturally weighted to last place*/
  42. #define prefcontweighting        0x00040000
  43.  
  44. enum commonFonts {
  45.     firstCommonFont,
  46.     chicagoFont = firstCommonFont,
  47.     courierFont,
  48.     genevaFont,
  49.     helveticaFont,
  50.     monacoFont,
  51.     newyorkFont,
  52.     symbolFont,
  53.     timesFont,
  54.     lastCommonFont = timesFont
  55. };
  56.  
  57. typedef long commonFont;
  58.  
  59. enum matchingStyles {
  60.     noMatching = 0,
  61.     useStyleMatching,
  62.     useVariationsMatching,
  63.     useTextFaceMatching= 4
  64. };
  65.  
  66. typedef long matchingStyle;
  67.  
  68. gxFont GetCommonFont(commonFont font);
  69. void SetShapeCommonFont(gxShape target, commonFont font);
  70. void SetStyleCommonFont(gxStyle target, commonFont font);
  71.  
  72. gxFont FindCNameFont(gxFontName meaning, const char name[]);
  73. gxFont FindPNameFont(gxFontName meaning, const unsigned char name[]);
  74.  
  75. long FindFontCName(gxFont fontID, gxFontName meaning, char name[]);
  76. long FindFontPName(gxFont fontID, gxFontName meaning, unsigned char name[]);
  77.  
  78. long FindStyleFontCName(gxStyle source, gxFontName meaning, char name[]);
  79. long FindStyleFontPName(gxStyle source, gxFontName meaning, unsigned char name[]);
  80. void SetStylePNamedFont(gxStyle target, const unsigned char name[]);
  81. void SetStyleCNamedFont(gxStyle target, const char* name);
  82.  
  83. long CountFontFamilies(void);
  84. gxFont FindFontFamily(long index, gxFontPlatform platform, gxFontScript script, gxFontLanguage language,
  85.   long nameLength, const unsigned char *name);
  86. long CountFontStyles(gxFont family);
  87. gxFont FindFontStyle(gxFont family, long index, gxFontPlatform platform, gxFontScript script, gxFontLanguage language,
  88.   long nameLength, const unsigned char *name);
  89.  
  90. void SetMatchingStyle(gxFont targetFamily, gxStyle theStyle, matchingStyle matchInfo);
  91. gxStyle ReturnMatchingStyle(gxFont targetFamily, gxStyle theStyle, matchingStyle matchInfo);
  92.  
  93. #ifdef __cplusplus
  94. }
  95. #endif
  96.  
  97. #endif /* __FONTLIBRARY__ */
  98.